using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;

namespace lang_benchmarks
{

    [TestFixture]
    public class LangTests
    {
        const int infty = 100000000;
        static int normal(int x)
        {
            if (x % 5 == 0)
                return infty;
            else
                return x;
        }

        static int? nullable(int x)
        {
            if (x % 5 == 0)
                return null;
            else
                return x;
        }
        [Test]
        public void NullableTest()
        {
            int n = 10000000;

            DateTime t0 = DateTime.Now;

            int hm = 0;
            for (int i = 0; i < n; i++)
                if (normal(i) == infty)
                    hm++;

            Console.WriteLine("Non-nullable int test:\t{0}", (DateTime.Now - t0));

            t0 = DateTime.Now;

            hm = 0;
            for (int i = 0; i < n; i++)
                if (nullable(i) == null)
                    hm++;

            Console.WriteLine("Nullable int test:\t{0}", (DateTime.Now - t0));
        }



    }
}